#ifndef INC_UMLOBJECT_H
#define INC_UMLOBJECT_H

#include "../base/Observable.h"
#include "BUMLSText.h"

#include <QPoint>   // Yeah, in the model. It's useful!
#include <QRect>

class DiagramVisitor;

class UMLObject : public Observable
{
	public:
		
		/*** CONSTRUCTION AND DESTRUCTION ***/

		UMLObject(const BUMLSText& text = BUMLSText());
		// default copy constructor

		virtual ~UMLObject();

		/**
		 * Just your normal assignment operator.
		 *
		 * CAVEAT EMPTOR: This operator is virtual, but assignments _must_ be
		 * made between objects of the same class. You will at best end up with
		 * a bad_cast exception if you do otherwise.
		 */
		virtual UMLObject& operator=(const UMLObject&);

		/**
		 * New's a clone of this object. A "virtual constructor".
		 */
		virtual UMLObject* clone() const = 0;

		/*** ACCESSORS ***/

		virtual QPoint position() const = 0;

		/**
		 * Note that this may be a complex operation for some objects.
		 */
		virtual void setPosition(const QPoint&) = 0;

		virtual QRect rect() const = 0;

		/**
		 * Sets the "end point" of the object. This has a slightly different
		 * meaning for different subclasses (mixed-instance?!), so see them for
		 * what it really does.
		 */
		virtual void setEnd(const QPoint&) = 0;

		/**
		 * @return a const reference to the object's internal BUMLSText. No, you
		 * may not modify it.
		 */
		const BUMLSText& text() const;
		void setText(const BUMLSText& text);

		virtual void accept(DiagramVisitor&) = 0;

	private:
		BUMLSText _text;
};


#endif // INC_UMLOBJECT_H

